<?php
$data = Controller::$pageData;
$youTube = array(
    361 => '<div class="youtube" id="NX1e6130cNQ"></div>',
    18273 => '<div class="youtube" id="NxppIa6f1Rw"></div>',
    21544 => '<div class="youtube" id="gpBGR-vtV9c"></div>',
    593 => '<div class="youtube" id="IxaJvfZvzBk"></div><br><div class="youtube" id="NX1e6130cNQ"></div>',
    11930 => '<div class="youtube" id="PK9p241PzSY"></div>',
    9288 => '<div class="youtube" id="1Blzl614Nmw"></div>',
    19825 => '<div class="youtube" id="_xnMfJzkrEI"></div>',
    12343 => '<div class="youtube" id="7fPr1yBi8dE"></div>',
    698 => '<div class="youtube" id="OtZA6Sw6Ax0"></div>',
    11640 => '<div class="youtube" id="AQciPAndraA"></div>',
    13493 => '<div class="youtube" id="3L3SN8s0MrI"></div>',
    365 => '<div class="youtube" id="56Y2Ih1NxoI"></div>',
    12007 => '<div class="youtube" id="SZD-vkjdWig"></div>',
    12998 => '<div class="youtube" id="Id8MuBt1hQw"></div>',
    696 => '<div class="youtube" id="MVvPJm72AUY"></div>',
    696 => '<div class="youtube" id="MVvPJm72AUY"></div><br><div class="youtube" id="kj4g3cJ4tag"></div><br><div class="youtube" id="wASKTyv8jD4"></div>',
    689 => '<div class="youtube" id="75SSXEBB930"></div>',
    4149 => '<div class="youtube" id="pDgz_U18-U4"></div><br><div class="youtube" id="HRgZvWwCCAI"></div>',
    12360 => '<div class="youtube" id="9MDIWW_wivs"></div><br><div class="youtube" id="qx3NbYVEDcs"></div><br><div class="youtube" id="qQxG9UiY90g"></div>',
    18273 => '<div class="youtube" id="K7FRy4krw3I"></div>',
    958 => '<div class="youtube" id="myHqUqRl3uw"></div><br><div class="youtube" id="ZNBbgjEDHNI"></div>',
    12345 => '<div class="youtube" id="uVUVpS7ydis"></div>',
    12121 => '<div class="youtube" id="UpOXfYTgzW8"></div>',
    1142 => '<div class="youtube" id="FHMYKAOoC0Y"></div><br><div class="youtube" id="xdPdVB1uuY8"></div>',
    12135 => '<div class="youtube" id="-0x8FYMAgls"></div>',
);
?>
<?php if (isset($youTube[$data['pageId']])) { ?>
    <noindex>
        <dl class="widget">
            <dt>Промо видео</dt>
            <dd>    
                <!--<div class="youtube" id="4OOwxD6Tkic"></div>    <br/>-->        

                <?php echo $youTube[$data['pageId']]; ?>

            </dd>
        </dl>
    </noindex>
    <script>
        var i, c, y, v, s, n;
        v = document.getElementsByClassName("youtube");
        if (v.length > 0) {
            s = document.createElement("style");
            s.type = "text/css";
            s.innerHTML = '.youtube{background-color:#000;max-width:100%;overflow:hidden;position:relative;cursor:hand;cursor:pointer}.youtube .thumb{bottom:0;display:block;left:0;margin:auto;max-width:100%;position:absolute;right:0;top:-30px;width:100%;height:auto}.youtube .play{filter:alpha(opacity=80);opacity:.8;height:77px;left:50%;margin-left:-38px;margin-top:-38px;position:absolute;top:50%;width:77px;background:url("") no-repeat}';
            document.body.appendChild(s)
        }
        for (n = 0; n < v.length; n++) {
            y = v[n];
            i = document.createElement("img");
            i.setAttribute("src", "http://i.ytimg.com/vi/" + y.id + "/hqdefault.jpg");
            i.setAttribute("class", "thumb");
            c = document.createElement("div");
            c.setAttribute("class", "play");
            y.appendChild(i);
            y.appendChild(c);
            y.onclick = function () {
                var a = document.createElement("iframe");
                a.setAttribute("src", "https://www.youtube.com/embed/" + this.id + "?autoplay=1&autohide=1&border=0&wmode=opaque&enablejsapi=1");
                a.setAttribute("width", "310");
                this.parentNode.replaceChild(a, this)
            }
        }
        ;
    </script>
    <style>
        .youtube {
            border-radius: 15px;
            width: 310;
            height: 150px;        
        }
    </style>
    <?php
}
?>